/*
 * Copyright (C) 2004-2007  Autodesk, Inc.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of version 2.1 of the GNU Lesser
 * General Public License as published by the Free Software Foundation.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
#ifndef FDOCMSRASTERDEFINITION_H
#define FDOCMSRASTERDEFINITION_H

#ifdef _WIN32
#pragma once
#endif //_WIN32

#include <CMS/FdoCMSOvProvider.h>

/// \brief
///  
/// The FdoCMSOvRasterDefinition class defines the physical overrides for a raster property in a CMS FDO schema.
class FdoCMSOvRasterDefinition : public FdoPhysicalElementMapping
{
	typedef FdoPhysicalElementMapping BaseType;
	friend class FdoCMSOvClassDefinition;

public:
    /// \brief
    /// Constructs a new Raster Definition.
    /// 
    /// \return
    /// Returns the newly created FdoCMSOvRasterDefinition instance.
    /// 
	FDOCMS_API static FdoCMSOvRasterDefinition* Create();

    /// \brief
    /// Gets the format type in which the CMS image will be generated.
    /// 
    /// \remarks
    /// Allowed map formats are "picture" formats . Picture formats constitute 
    /// a rectangular pixel array of fixed size. Picture formats include file types such 
    /// as Portable Network Graphics (PNG), Joint Photographics Expert Group (JPEG) 
    /// and file types such as Tagged Image File Format (TIFF).
    /// 
    /// \return
    /// Returns the CMS image format.
    /// 
    FDOCMS_API FdoString* GetImageFormat(void);

    /// \brief
    /// Sets the format type in which the CMS image will be generated.
    /// 
    /// \remarks
    /// Allowed map formats are "picture" formats . Picture formats constitute 
    /// a rectangular pixel array of fixed size. Picture formats include file types such 
    /// as Portable Network Graphics (PNG), Joint Photographics Expert Group (JPEG) 
    /// and file types such as Tagged Image File Format (TIFF).
    /// 
    /// \return
    /// Returns nothing.
    /// 
    FDOCMS_API void SetImageFormat(FdoString* value);

    /// \brief
    /// Gets the fully qualified name of this element
    /// 
    /// \return
    /// Returns the qualified element name
    /// 
    FDOCMS_API virtual FdoStringP GetQualifiedName();

/// \cond DOXYGEN-IGNORE

    /// XML Serialization functions, not part of supported API.
	FDOCMS_API virtual void InitFromXml(FdoXmlSaxContext* pContext, FdoXmlAttributeCollection* attrs);
    FDOCMS_API virtual FdoXmlSaxHandler* XmlStartElement(
        FdoXmlSaxContext* context, 
        FdoString* uri, 
        FdoString* name, 
        FdoString* qname, 
        FdoXmlAttributeCollection* atts
    );
    FDOCMS_API virtual FdoBoolean XmlEndElement(FdoXmlSaxContext* context, FdoString* uri, FdoString* name, FdoString* qname);
    FDOCMS_API void _writeXml( FdoXmlWriter* xmlWriter, const FdoXmlFlags* flags );

protected:
	FDOCMS_API FdoCMSOvRasterDefinition(void);
	FDOCMS_API virtual ~FdoCMSOvRasterDefinition(void);

protected:
    void _SetFullFormatType(FdoString* value);

    void _SetFormatAbbr(FdoString* value);
    FdoStringP _GetFormatAbbr() const;

	void Dispose(void);

    //FdoStringP MIMEFormatTypeToAbbr(FdoString* fullFormat);
    //FdoStringP AbbrToMIMEFormatType(FdoString* abbrFormat);
private:
    FdoStringP m_formatType;
    // TODO: DO we need Get/Set Map Format
    FdoStringP m_mapFormatType; 
    FdoXmlCharDataHandler *m_pXmlContentHandler;

/// \endcond

};

/// \brief
///  FdoCMSOvRasterDefinitionP is a FdoPtr on FdoCMSOvRasterDefinition, provided for convenience. 
typedef FdoPtr<FdoCMSOvRasterDefinition> FdoCMSOvRasterDefinitionP;

#endif  // FDOCMSRASTERDEFINITION_H


